<?php
/**
 * 全局配置文件
 *
 * @author 孙晓晔
 * @version $Id: config.php 1033 2010-03-25 11:26:55Z sunxy $
 */

date_default_timezone_set('PRC');

function cur_time() {
	$mtime = explode(" ", microtime());
	return $mtime[1] + $mtime[0];
}

function logdate() {
	$starttime = $_REQUEST['starttime'];

	$endtime = cur_time();
	$totaltime = (cur_time() - $starttime);
	$totaltime = number_format($totaltime, 7);

	echo "\n";
	echo "starttime = " . date("Y-m-d H:i:s", $starttime) . "\n";
	echo "endtime = " . date("Y-m-d H:i:s", $endtime) . "\n";
	echo "totaltime = " . $totaltime . "\n";
}

$_REQUEST['starttime'] = cur_time();

if (!defined('SMARTY_LIB')) define('SMARTY_LIB', APP_LIB);

$cfg['mysql'] = array(
	"admin" => array("host"=>"localhost", "user"=>"sunxy", "pass"=>"1234", "db"=>"admin"),
	"test" => array("host"=>"localhost", "user"=>"sunxy", "pass"=>"1234", "db"=>"test"),
	"cdr" => array("host"=>"ns11", "user"=>"sunxy", "pass"=>"1234", "db"=>"asteriskcdrdb"),
	"wifi" => array("host"=>"localhost", "user"=>"sunxy", "pass"=>"1234", "db"=>"wifi"),

// read slave
	"ydt" => array("host"=>"localhost", "user"=>"sunxy", "pass"=>"1234", "db"=>"ydt"),

// write master
	"_ydt" => array("host"=>"localhost", "user"=>"sunxy", "pass"=>"1234", "db"=>"ydt"),

	"emp" => array("host"=>"localhost", "user"=>"sunxy", "pass"=>"1234", "db"=>"ydt"),
);

$cfg['asterisk'] = array(
	'ns' => array('server'=>'ns11', 'username'=>'admin', 'secret'=>'amp111'),
	'sj' => array('server'=>'sj11', 'username'=>'admin', 'secret'=>'amp111'),
	'qx' => array('server'=>'qx11', 'username'=>'admin', 'secret'=>'amp111'),
	'fy' => array('server'=>'fy', 'username'=>'admin', 'secret'=>'amp111'),
	'tt' => array('server'=>'tt.sip.tecmold.com', 'username'=>'admin', 'secret'=>'amp111')
);

$cfg['memcached'] = array(
	'root' => array('host'=>'localhost', 'port'=>11211),
	'test' => array('host'=>'localhost', 'port'=>11211),
);

$cfg['workerman'] = array(
	'root' => array('host'=>'127.0.0.1', 'port'=>1032),
	'test' => array('host'=>'127.0.0.1', 'port'=>6001),
);

$cfg['mogilefs'] = array(
	'ydt' => array('host'=>'192.168.16.13', 'port'=>7001, 'domain'=>'ydt', 'class'=>'upload'),
	'test' => array('host'=>'localhost', 'port'=>7001, 'domain'=>'test', 'class'=>'upload'),
);

$cfg['ftp'] = array(
    "tt" => array("host"=>"ftp.tecmold.com", "port"=>"21", "user"=>"tt", "pass"=>"222", "dir"=>"/"),
);

$cfg['upload'] = '/home/ftp/tecmold.com';

require_once(dirname(__FILE__) . "/function.php");
require_once(dirname(__FILE__) . "/Constant.class.php");

require_once(APP_LIB . "/Common.class.php");
require_once(APP_LIB . "/Name.class.php");
require_once(APP_LIB . "/Id.class.php");
require_once(APP_LIB . "/Download.class.php");
?>
